package cn.lg.soar.redis.model;

import cn.lg.soar.core.config.cache.CacheInfo;
import io.swagger.v3.oas.annotations.media.Schema;

import java.util.Map;

public class RedisInfo extends CacheInfo {

    @Schema(description = "运行时长(秒)")
    private Long uptime;

    @Schema(description = "CPU使用率")
    private Float cpuUsage;

    @Schema(description = "操作系统")
    private String os;

    @Schema(description = "架构位数")
    private String archBits;

    @Schema(description = "版本号")
    private String version;

    @Schema(description = "总共连接数")
    private Integer totalConnectionsReceived;

    @Schema(description = "当前连接数")
    private Integer connectedClients;

    @Schema(description = "阻塞客户端数")
    private Integer blockedClients;

    @Schema(description = "处理过的命令数")
    private Integer totalCommandsProcessed;

    @Schema(description = "每秒处理的命令数")
    private Integer instantaneousOpsPerSec;

    @Schema(description = "接收量(字节)")
    private Long totalNetInputBytes;

    @Schema(description = "发送量(字节)")
    private Long totalNetOutputBytes;

    @Schema(description = "淘汰策略")
    private String maxmemoryPolicy;

    @Schema(description = "碎片率")
    private String memFragmentationRatio;

    @Schema(description = "成功查询 key 的次数")
    private Long keyspaceHits;

    @Schema(description = "失败查询 key 的次数")
    private Long keyspaceMisses;

    @Schema(description = "已过期并被删除的 key 数量")
    private Long expiredKeys;

    @Schema(description = "因内存不足被淘汰的 key 数量")
    private Long evictedKeys;

    @Schema(description = "设置了过期时间的 key 数量")
    private Long expires;

    @Schema(description = "是否开启 AOF 持久化")
    private Boolean aofEnabled;

    @Schema(description = "是否正在执行 RDB 快照保存")
    private Boolean rdbBgsaveInProgress;

    @Schema(description = "是否正在进行 AOF 重写")
    private Boolean aofRewriteInProgress;

    @Schema(description = "当前 AOF 文件大小")
    private Long aofCurrentSize;

    @Schema(description = "上次成功保存 RDB 的时间戳")
    private String rdbLastSaveTime;

    @Schema(description = "延迟 fsync 的次数")
    private Long aofDelayedFsync;

    @Schema(description = "dbs")
    private Map<Integer, String> dbs;


    public RedisInfo() {
        super("redis");
    }

    public Long getUptime() {
        return uptime;
    }

    public void setUptime(Long uptime) {
        this.uptime = uptime;
    }

    public Float getCpuUsage() {
        return cpuUsage;
    }

    public void setCpuUsage(Float cpuUsage) {
        this.cpuUsage = cpuUsage;
    }

    public String getOs() {
        return os;
    }

    public void setOs(String os) {
        this.os = os;
    }

    public String getArchBits() {
        return archBits;
    }

    public void setArchBits(String archBits) {
        this.archBits = archBits;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public Integer getTotalConnectionsReceived() {
        return totalConnectionsReceived;
    }

    public void setTotalConnectionsReceived(Integer totalConnectionsReceived) {
        this.totalConnectionsReceived = totalConnectionsReceived;
    }

    public Integer getConnectedClients() {
        return connectedClients;
    }

    public void setConnectedClients(Integer connectedClients) {
        this.connectedClients = connectedClients;
    }

    public Integer getBlockedClients() {
        return blockedClients;
    }

    public void setBlockedClients(Integer blockedClients) {
        this.blockedClients = blockedClients;
    }

    public Integer getTotalCommandsProcessed() {
        return totalCommandsProcessed;
    }

    public void setTotalCommandsProcessed(Integer totalCommandsProcessed) {
        this.totalCommandsProcessed = totalCommandsProcessed;
    }

    public Integer getInstantaneousOpsPerSec() {
        return instantaneousOpsPerSec;
    }

    public void setInstantaneousOpsPerSec(Integer instantaneousOpsPerSec) {
        this.instantaneousOpsPerSec = instantaneousOpsPerSec;
    }

    public Long getTotalNetInputBytes() {
        return totalNetInputBytes;
    }

    public void setTotalNetInputBytes(Long totalNetInputBytes) {
        this.totalNetInputBytes = totalNetInputBytes;
    }

    public Long getTotalNetOutputBytes() {
        return totalNetOutputBytes;
    }

    public void setTotalNetOutputBytes(Long totalNetOutputBytes) {
        this.totalNetOutputBytes = totalNetOutputBytes;
    }

    public String getMaxmemoryPolicy() {
        return maxmemoryPolicy;
    }

    public void setMaxmemoryPolicy(String maxmemoryPolicy) {
        this.maxmemoryPolicy = maxmemoryPolicy;
    }

    public String getMemFragmentationRatio() {
        return memFragmentationRatio;
    }

    public void setMemFragmentationRatio(String memFragmentationRatio) {
        this.memFragmentationRatio = memFragmentationRatio;
    }

    public Long getKeyspaceHits() {
        return keyspaceHits;
    }

    public void setKeyspaceHits(Long keyspaceHits) {
        this.keyspaceHits = keyspaceHits;
    }

    public Long getKeyspaceMisses() {
        return keyspaceMisses;
    }

    public void setKeyspaceMisses(Long keyspaceMisses) {
        this.keyspaceMisses = keyspaceMisses;
    }

    public Long getExpiredKeys() {
        return expiredKeys;
    }

    public void setExpiredKeys(Long expiredKeys) {
        this.expiredKeys = expiredKeys;
    }

    public Long getEvictedKeys() {
        return evictedKeys;
    }

    public void setEvictedKeys(Long evictedKeys) {
        this.evictedKeys = evictedKeys;
    }

    public Long getExpires() {
        return expires;
    }

    public void setExpires(Long expires) {
        this.expires = expires;
    }

    public Boolean getAofEnabled() {
        return aofEnabled;
    }

    public void setAofEnabled(Boolean aofEnabled) {
        this.aofEnabled = aofEnabled;
    }

    public Boolean getRdbBgsaveInProgress() {
        return rdbBgsaveInProgress;
    }

    public void setRdbBgsaveInProgress(Boolean rdbBgsaveInProgress) {
        this.rdbBgsaveInProgress = rdbBgsaveInProgress;
    }

    public Boolean getAofRewriteInProgress() {
        return aofRewriteInProgress;
    }

    public void setAofRewriteInProgress(Boolean aofRewriteInProgress) {
        this.aofRewriteInProgress = aofRewriteInProgress;
    }

    public Long getAofCurrentSize() {
        return aofCurrentSize;
    }

    public void setAofCurrentSize(Long aofCurrentSize) {
        this.aofCurrentSize = aofCurrentSize;
    }

    public String getRdbLastSaveTime() {
        return rdbLastSaveTime;
    }

    public void setRdbLastSaveTime(String rdbLastSaveTime) {
        this.rdbLastSaveTime = rdbLastSaveTime;
    }

    public Long getAofDelayedFsync() {
        return aofDelayedFsync;
    }

    public void setAofDelayedFsync(Long aofDelayedFsync) {
        this.aofDelayedFsync = aofDelayedFsync;
    }

    public Map<Integer, String> getDbs() {
        return dbs;
    }

    public void setDbs(Map<Integer, String> dbs) {
        this.dbs = dbs;
    }

}
